/*
  采用Vue的Mixin特性编写一个用于实际渲染的Vue模板的接口类
  用于组件开发时定义组件类必须拥有的属性及方法
*/

const definitionTemplate = {
	data() {
		return {
			name: 0, // 组件Vue注册名
			width: 0,
			height: 0,
			styleOption: [],
			staticData: '', //
			apiData: {},
			serviceListData: [],
			dataSourceType: '',
			base: {}
		};
	},

	props: {
		dataFormatter: {
			// 数据格式化回调
			type: Function,
			default: () => {}
		},
		styleFormatter: {
			// 样式格式化回调
			type: Function,
			default: () => {}
		},
		eventFormatter: {
			// 提交前钩子
			type: Function,
			default: () => {}
		},
		styleConfiguration: {
			type: Object
		}
	},
	method: {
		getDataSource: function () {
			return [];
		},
		getEvent: function () {
			return [];
		},
		getAction: function () {
			return [];
		}
	}
};

export default definitionTemplate;
